import 'package:json_annotation/json_annotation.dart';

part 'user_model.g.dart';

@JsonSerializable()
class UserModel extends Object {
  @JsonKey(name: 'token')
  String token;

  @JsonKey(name: 'is_new')
  bool isNew;

  @JsonKey(name: 'mobile')
  String mobile;

  @JsonKey(name: 'udid')
  String ? udid;

  @JsonKey(name: 'uuid')
  String uuid;

  @JsonKey(name: 'uid')
  String uid;

  @JsonKey(name: 'username')
  String username;

  @JsonKey(name: 'is_tourist')
  int isTourist;

  UserModel(
    this.token,
    this.isNew,
    this.mobile,
    this.udid,
    this.uuid,
    this.uid,
    this.username,
    this.isTourist,
  );

  factory UserModel.fromJson(Map<String, dynamic> srcJson) =>
      _$UserModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$UserModelToJson(this);
}
